//
//  MemoryViewController.m
//  笔试
//
//  Created by dengbb on 16/3/1.
//  Copyright © 2016年 mohekeji. All rights reserved.
//

#import "MemoryViewController.h"

@interface MemoryViewController ()

@end

@implementation MemoryViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    NSString *name = @"abc";
    [name autorelease];
    @autoreleasepool {
        /*
         自动释放池(Autorelease Pool)的概念，是可以存放一些实体的
         
         集合，在这个自动释放池中的对象，是能够被自动释放的。NSObject类提供了一个autorelease
         
         消息，当我们向一个对象发送一个autorelease消息时，这个对象就被放入到自动释放池。
         
         创建自动释放池
         */
        NSString *tom=[[NSString alloc]init];
        [tom autorelease];
        NSLog(@"pool exist");
    }
    NSLog(@"pool dead");
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
